package rs.daolao.syc.admin.account.dao.search;

import org.springframework.data.elasticsearch.annotations.Query;
import org.springframework.data.elasticsearch.repository.ElasticsearchRepository;
import org.springframework.stereotype.Repository;
import rs.daolao.syc.admin.account.pojo.vo.DoctorSearchVO;


import java.util.List;

@Repository
public interface IDoctorSearchRepository extends ElasticsearchRepository<DoctorSearchVO,Long> {
    @Query("{\n" +
            "    \"bool\": {\n" +
            "      \"should\": [\n" +
            "        {\n" +
            "          \"match\": {\n" +
            "            \"userName\": \"?0\"\n" +
            "          }\n" +
            "        },\n" +
            "        {\n" +
            "          \"match\": {\n" +
            "            \"name\": \"?0\"\n" +
            "          }\n" +
            "        }, {\n" +
            "          \"match\": {\n" +
            "            \"hospital\": \"?0\"\n" +
            "          }\n" +
            "        }, {\n" +
            "          \"match\": {\n" +
            "            \"department\": \"?0\"\n" +
            "          }\n" +
            "        }, {\n" +
            "          \"match\": {\n" +
            "            \"duty\": \"?0\"\n" +
            "          }\n" +
            "        }, {\n" +
            "          \"match\": {\n" +
            "            \"phone\": \"?0\"\n" +
            "          }\n" +
            "        }, {\n" +
            "          \"match\": {\n" +
            "            \"roleName\": \"?0\"\n" +
            "          }\n" +
            "        }\n" +
            "      ]\n" +
            "    }\n" +
            "  }")
    List<DoctorSearchVO> customQueryDoctor(String word);
}
